<?php

namespace app\home\validate;

use think\Validate;

class Index extends Validate {
    
    /**
     * 规则定义
     * @var array
     */
    protected $rule = [
        'link' => ['require','length' => '12,250', 'regex' => '/(http|https):\/\/([\w.]+\/?)\S*/'],
    ];
    
    /**
     * 提示信息定义
     * @var array
     */
    protected $message = [
        'link' => '请输入12-250字符http或https协议链接地址',
    ];
    
    /**
     * 场景定义
     * @var array
     */
    public $scene = [
        'buildUrl' => ['link'],
    ];
}